Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve some handling around packages #323

Merged

Conversation

stvnrhodes
Copy link
Contributor

@stvnrhodes stvnrhodes commented Sep 15, 2023

This is a handful of minor tweaks to help with package-related commands. The most important tweak is making packages update properly downgrade when requested.

  • Add a mode for packages list that gives a format closer to what we use elsewhere in sansshell package commands
  • Validate that the package we wanted to install was actually installed in both InstallPackage and UpdatePackage
  • Print out flags on some usage errors
  • Add some more help text for installation commands so that there's
  • Automatically use yum downgrade instead of update-to when UpdatePackage is called to update a package to an older version

Interestingly, the behavior of yum install-nevra semms to differ between centos7 and fedora. On centos7 I see it refusing to downgrade and on fedora I see it installing the exact specified version.

We don't have proper integration tests for this, so I did manual tests with commands going back-and-forth like sanssh --targets localhost packages update -name bash -new_version 0:4.2.46-35.el7_9.x86_64 -old_version 0:4.2.46-34.el7.x86_64

@sfc-gh-srhodes sfc-gh-srhodes marked this pull request as ready for review September 22, 2023 16:43
Copy link
Collaborator

@sfc-gh-elinardi sfc-gh-elinardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! this'll make it much less painful to upgrade / downgrade packages

- Add a mode for `packages list` that gives a format closer to what we use elsewhere in sansshell
- Validate that the package we wanted to install was actually installed in both `InstallPackage` and `UpdatePackage`
- Print out flags on some usage errors
- Automatically use `yum downgrade` instead of `update-to` when `UpdatePackage` is called to update a package to an older version

Interestingly, the behavior of `yum install-nevra` semms to differ between centos7 and fedora. On centos7 I see it refusing to downgrade and on fedora I see it installing the exact specified version.
@stvnrhodes stvnrhodes force-pushed the improve-package-handling branch from c75c5ef to f76b9ab Compare September 25, 2023 19:05
@sfc-gh-srhodes sfc-gh-srhodes merged commit c872598 into Snowflake-Labs:main Sep 25, 2023
3 checks passed
@stvnrhodes stvnrhodes deleted the improve-package-handling branch October 13, 2023 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants